using System;
using System.Collections.Generic;
using System.Text;
using Fodee.DataEntity;
using Fodee.DataAccess;
using System.Data;

namespace Fodee.BusinessComponent
{
    public class TableCategoryBC : BCBase
    {
        private TableCategoryDA da = new TableCategoryDA();

        public FodeeDataSet GetAll()
        {
            FodeeDataSet dsSystem = new FodeeDataSet();
            DataSet ds = da.GetAll(dsSystem.fod_TableCategory.TableName.ToString());
            if (ds != null)
            {
                dsSystem.fod_TableCategory.Merge(ds.Tables[0]);
            }
            return dsSystem;
        }

        public FodeeDataSet GetById(int id)
        {
            FodeeDataSet ds = new FodeeDataSet();
            ds = da.GetById(id, ds.fod_TableCategory.TableName.ToString()) as FodeeDataSet;
            return ds;
        }

        public bool Insert(FodeeDataSet ds)
        {
            return da.Insert(ds, ds.fod_TableCategory.TableName.ToString());
        }

        public bool Update(FodeeDataSet ds)
        {
            return da.Update(ds, ds.fod_TableCategory.TableName.ToString());
        }

        public bool Delete(FodeeDataSet ds)
        {
            return da.Delete(ds, ds.fod_TableCategory.TableName.ToString());
        }
    }
}
